#include using namespace std; void fun(int& r) { r = 99; } void main(int argc, char* argv[]) { //pointer is a variable that holds an address int y = 9; // * - in C++ int x = 8 * 7; //* multiply //NULL means an address that should not be used int* p = NULL; //p is a pointer to integer &x; //finding the address of x p = &x; if(p != NULL) { *p = 77; //* - what's at... dereference operator cout << "*p : " << *p << endl; cout << "p: " << p << endl; } //& - in C++ if(x > 10 && y == 9) { cout << "example of binary &&" << endl; } int z = x & y; //& - bitwise and cout << z << endl; fun(z); int& w = z; //& - reference variable w = 7; cout << z << endl; char name[] = "Dana"; cout << name << endl; //char* stuff; //cout << stuff << endl; int a[] = {1,2,3,4,5,6,7,8,9}; cout << a << endl; cout << *a << a[0] << endl; cout << *(a+1) << a[1] << endl; //pointer arithmetic //walking a pointer for(int* pa = a; pa < a + 9; pa++) { cout << *pa << endl; } }